<template>
  <div class="login-container">
    <div class="avatar">
      <img src="../assets/logo.png" alt="">
    </div>

    <el-form :model="loginForm" :rules="loginFormRules" ref="ruleFormRef">
      <el-form-item prop="username">
        <el-input v-model="loginForm.username"></el-input>
      </el-form-item>
      <el-form-item prop="password">
        <el-input v-model="loginForm.password" type="password"></el-input>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="submitForm">登录</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>

    </el-form>

  </div>
</template>
<script>
import mix from './Login-mixins.js'
export default {
  mixins: [mix]
}
</script>
<style lang="less" scoped>
.login-container {
  width: 450px;
  height: 304px;
  background: #fff;
  border-radius: 4px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  .avatar {
    padding: 10px;
    background: #fff;
    width: 130px;
    height: 130px;
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    box-shadow: 0 0 10px #ccc;
    img {
      border-radius: 50%;
      width: 100%;
      background: #eeeeee;
    }
  }
  .el-form {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
    .el-form-item:last-child{
      float: right;
    }
  }
}
</style>
